package com.welink.cmp.meatdata.service;

import com.welink.cmp.dto.metadata.MetadataIdListQry;
import com.welink.cmp.dto.metadata.host.clientobject.HostBasicCO;
import com.welink.cmp.dto.metadata.host.clientobject.HostCO;
import com.welink.cmp.dto.metadata.host.query.HostListByPageQry;
import com.welink.cmp.meatdata.command.HostCmdExe;
import com.welink.common.dto.PageResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Host应用查询服务类
 * 提供Host相关的查询接口
 */
@Service
public class HostAppQueryService {

    @Autowired
    private HostCmdExe hostCmdExe;

    /**
     * [ID查询]根据ID获取Host
     *
     * @param id Host ID
     * @return Host业务对象
     */
    public HostCO getHostById(Long id) {
        return hostCmdExe.queryById(id);
    }

    /**
     * 列表查询Host
     *
     * @param listQry 列表查询条件
     * @return Host业务对象列表
     */
    public List<HostCO> hostListQuery(MetadataIdListQry listQry) {
        return hostCmdExe.listQuery(listQry);
    }

    /**
     * 分页查询Host
     *
     * @param pageQry 分页查询条件
     * @return 分页响应，包括Host列表和分页信息
     */
    public PageResponse<HostBasicCO> hostPageQuery(HostListByPageQry pageQry) {
        return hostCmdExe.pageQuery(pageQry);
    }
}